package com.zang.blogz.utils;

import java.io.PrintWriter;
import java.io.StringWriter;

/**
 * @Author: ZVerify
 * @Description: TODO
 * @DateTime: 2022/9/3 10:42
 **/
public class ErrorUtils {

    public static String getTrace(Throwable t) {
        StringWriter stringWriter = new StringWriter();
        PrintWriter writer = new PrintWriter(stringWriter);
        t.printStackTrace(writer);
        StringBuffer buffer = stringWriter.getBuffer();
        return buffer.toString();
    }

}

